package com.estar.assistsurvy.thread;

import com.estar.assistsurvy.constant.Constants;
import com.estar.assistsurvy.entity.RequestGrabLocation;
import com.estar.assistsurvy.entity.ResponseGrabLocation;

import android.content.Context;
import android.os.Handler;
import android.util.Log;

public class GetGrabLocation extends BaseThread {

	private RequestGrabLocation requestGrabLoc;

	public GetGrabLocation(Context context, Handler handler, RequestGrabLocation requestGrabLoc) {
		super(context, handler);
		this.requestGrabLoc = requestGrabLoc;
	}
	
	@Override
	public void run() {
		// TODO Auto-generated method stub
		url_str=Constants.NAMESPACE+Constants.GRAB_LOCATION;
		json=gson.toJson(requestGrabLoc);
		postRequest(url_str, json);
		Log.i("wl", "其他查勘员位置"+result);
		if(result!=null){
			ResponseGrabLocation grabLocation=new ResponseGrabLocation();
			grabLocation=gson.fromJson(result, ResponseGrabLocation.class);
			msg.what=1;
			msg.obj=grabLocation;
			msg.sendToTarget();
		}
	}
}
